<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //  实现流氓广告的关闭 （div里有一个 X 点击x的时候可以关闭div，但是过4秒后div又会显示出来）
        window.onload = function(){
            var s = document.querySelector(".sp");
            var boxelm = document.querySelector(".box");
            s.onclick = function () {
                boxelm.style.display = "none"
                setTimeout(function(){
                    boxelm.style.display = "block"
                },4000)
            }
        }
    </script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 250px;
            height: 250px;
            background-color: rgb(77, 104, 224);
            position: absolute;
            right: 20px;
            bottom: 20px;
            /* display: block; */
        }
        .box .sp{
            float: right;
            margin-top: 0px;
            margin-right: 10px;
            font-size: 25px;
        }
        .box .sp:hover{
            cursor:pointer;
        }
    </style>
</head>

<body>
    <div class="box">
        <span class="sp">x</span>
    </div>
</body>

</html>